<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.Date"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>这是一个测试的JSP文件</title>
</head>
<body>
当前的系统时间是：
<%
	Date date = new Date();
	out.println(date.toString());
%>
<br>
<br>
<br>
中文的系统时间是：<br>
<%
	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
	Date currentTime = new Date();
	String time1 = currentTime.toString();
	String time2 = sdf.format(currentTime);
	//out.println("<br>");
	out.println("直接转成字符串的时间： "+time1);
	out.println("<br>");
	out.println("格式转化以后的时间："+time2);
	out.println("<br>");
%>
</body>
</html>